package com.lu.bean;

import com.lu.constant.ErrorEnum;
import lombok.Data;
import lombok.ToString;

/**
 * @author issuser
 * @ClassName AppException
 * @Description
 * @date 2021/07/12 20:19
 */
@ToString
@Data
public class AppException extends Exception {
    private String errorCode;
    private String errorMsg;

    public AppException() {}

    public AppException(String errorCode,String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public AppException(ErrorEnum errorEnum) {
        this.errorCode = errorEnum.code;
        this.errorMsg = errorEnum.desc;
    }

}
